<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">
<html>
<head>
<title>How the Library Works</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="generator" content="Doc-O-Matic" />
    <meta http-equiv="Content-Style-Type" content="text/css" />
    <link rel="STYLESHEET" href="default.css" type="text/css" />

<script type="text/javascript" src="scripts.js"></script>
</head>
<body class="Element700" onload="onBodyLoadEx('frames.html', 'topic', '00714.html');" onmousedown="onBodyMouseDown();">

<!-- Begin Popups -->

<!-- End Popups -->

<!-- Begin Page Header -->
<div class="Element710" id="areafixed">
<div class="Element94">
<a href="01259.html" target="topic">System Service Libraries Help</a> &gt; <a href="00716.html" target="topic">Debug System Service Library Help</a> &gt; <a href="00719.html" target="topic">Using the Library</a> &gt; <a href="00714.html" target="topic">How the Library Works</a></div>
<div class="Element92">
<table width="100%" cellspacing="0" cellpadding="0">
<tr><td width="25%">
<div class="Element1">
MPLAB Harmony Core Help</div>
</td><td width="25%">
<div class="Element2">
<a href="contents.html" target="tocidx">Contents</a> | <a href="00007.html" target="topic">Home</a></div>
</td><td width="25%">
<div class="Element90">
<a href="00709.html" target="topic">Previous</a> | <a href="00719.html" target="topic">Up</a> | <a href="00712.html" target="topic">Next</a></div>
</td><td width="25%">
<div class="Element96">
<a href="mailto:docerrors@microchip.com&subject=MPLAB Harmony Documentation Feedback (Topic ID: SYS DEBUG How the Library Works Topic Title: How the Library Works)&body=Thank you for your feedback! Please include a description of your feedback, and indicate whether you are reporting an an error in the documentation or an enhancement.">Documentation Feedback</a><br> <a href="http://support.microchip.com" target="_blank">Microchip Support</a></div>
</td></tr></table><div class="Element5">
How the Library Works</div>
</div>
</div>

<!-- End Page Header -->

<!-- Begin Client Area -->
<div class="Element720" id="areascroll">
<div class="Element721">

<!-- Begin Page Content -->
<a name="PageContent"></a><div class="Element58">
<a name="4465736372697074696F6E"></a><div class="Element11">
<div class="Element10">
<p class="Element10">
 &nbsp;</p>
<p class="Element10">
<strong>Debug Messages and Error Reporting</strong>&nbsp;</p>
<p class="Element10">
The following macros are available to output debug and error messages. The default implementation of these macros resolves to nothing by the preprocessor. This is to allow the developer to leave debug messaging in the released code without impacting code size or performance. Typically, the developer would define SYS_DEBUG_USE_CONSOLE macro through MHC configuration for debug builds, to map these macros to appropriate debug service implementation.</p>
<ul class="Element630">
<li class="Element600">SYS_MESSAGE(message) prints a simple message string to the output device irrespective of the value of the global error level</li>
<li class="Element600"><a href="00859.html" target="topic">SYS_DEBUG_MESSAGE</a>(level, message) prints a debug message to the console device if the global error level is equal to or lower than that specified by the &quot;level&quot; argument</li>
<li class="Element600">SYS_PRINT(fmt, ...) prints formatted messages to the console. The message formatting is the same as printf</li>
<li class="Element600"><a href="00860.html" target="topic">SYS_DEBUG_PRINT</a>(level, fmt, ...) prints formatted messages to the console if the global error level is equal to or lower than that specified by the &quot;level&quot; argument. The message formatting is the same as printf</li>
</ul><p class="Element10">
<strong>Changing the System Error Level</strong>&nbsp;</p>
<p class="Element10">
Two functions are provided to manipulate the global system error level at runtime. This may be useful when you want to increase the debug verbosity for a particular section of code, but not for the entire program</p>
<ul class="Element630">
<li class="Element600"><a href="00855.html" target="topic">SYS_DEBUG_ErrorLevelGet</a>() returns the current global system error level</li>
<li class="Element600"><a href="00856.html" target="topic">SYS_DEBUG_ErrorLevelSet</a>(level) sets the current global system error level</li>
</ul></div>
</div>
</div>
<!-- End Page Content -->

<!-- Begin Page Footer -->
<div class="Element95">
<a href="01259.html" target="topic">System Service Libraries Help</a> &gt; <a href="00716.html" target="topic">Debug System Service Library Help</a> &gt; <a href="00719.html" target="topic">Using the Library</a> &gt; <a href="00714.html" target="topic">How the Library Works</a></div>
<div class="Element93">
<table width="100%" cellspacing="0" cellpadding="0">
<tr><td width="25%">
<div class="Element3">
MPLAB Harmony Core Help</div>
</td><td width="25%">
<div class="Element4">
<a href="contents.html" target="tocidx">Contents</a> | <a href="00007.html" target="topic">Home</a></div>
</td><td width="25%">
<div class="Element91">
<a href="00709.html" target="topic">Previous</a> | <a href="00719.html" target="topic">Up</a> | <a href="00712.html" target="topic">Next</a></div>
</td><td width="25%">
<div class="Element97">
<a href="mailto:docerrors@microchip.com&subject=MPLAB Harmony Documentation Feedback (Topic ID: SYS DEBUG How the Library Works Topic Title: How the Library Works)&body=Thank you for your feedback! Please include a description of your feedback, and indicate whether you are reporting an an error in the documentation or an enhancement.">Documentation Feedback</a><br> <a href="http://support.microchip.com" target="_blank">Microchip Support</a></div>
</td></tr></table></div>

<!-- End Page Footer -->
</div>
</div>

<!-- End Client Area -->
</body></html>